home *** CD-ROM | disk | FTP | other *** search
- /*______________________________________________________*/
- /* Sound I/O Demo */
- /* by */
- /* RICHARD P. COLLYER */
- /* Developer Technical Support */
- /* Apple Computer, Inc. */
- /* 11/14/91 */
- /*______________________________________________________*/
-
- /**********************************/
- /* #includes */
- /**********************************/
-
- #include <Dialogs.h>
- #include <GestaltEqu.h>
- #include <Memory.h>
- #include <OSEvents.h>
- #include <Packages.h>
- #include <Quickdraw.h>
- #include <Sound.h>
- #include <SoundInput.h>
- #include <StdIO.h>
- #include <Types.h>
- #include <Windows.h>
-
- /**********************************/
- /* #defines */
- /**********************************/
-
- // Used as a macro to simplify one line of code. Use an exclusive OR to switch from 0 to 1,
- // or from 1 to 0. This is the index for our two buffer handle array
-
- #define NextBuffer(x) (x ^= 1)
-
- //The number of Milliseconds of sound which is recorded before playback
- #define kMilliSecondsOfSound 1000
-
- //Size of the top of the 'snd ' header
- #define kBaseHeaderSize 6
-
- //Multiplier to determine the size of the Synths in the header
- #define kSynthSize 6
-
- //Multiplier to determine the size of the Cmds in the header
- #define kCmdSize 8
-
- // Number of buffers being used
- #define kNumberOfBuffers 2
-
- // When building the SndHeader I use this constant to declare Middle C base Frequency
- #define kMiddleC 0x3C
-
- // the error dialog for messages
- #define kErrorDialogID 128
-
- // OK Button ID for the Error Handling Dialog
- #define kOKButton 1
-
- // this is the static text item used to display the OSErr
- #define kErrNumStatText 5
-
- // this is the static text item used to display a message to the user
- #define kMsgStatText 2
-
- // nil used to open the default sound input driver
- #define kDefaultDriver nil
-
- // estimate the largest 'snd ' header that we could imagine
- #define kEstimatedHeaderSize (sizeof (SndListResource) + sizeof (ExtSoundHeader))
-